import request from '@/utils/request'
// 客户池
// ——查询客户池
export function getCustomerData(params) {
  return request({
    url: '/system/customer/pool',
    method: 'get',
    params,
  })
}
// ——新增客户
export function setCustomerAdd(data) {
  return request({
    url: '/system/customer/pool',
    method: 'post',
    data,
  })
}
// ——修改客户
export function setCustomerUpdate(data) {
  return request({
    url: '/system/customer/pool',
    method: 'put',
    data,
  })
}
// ——跟进客户
export function setCustomerFollow(data) {
  return request({
    url: '/system/customer/pool/follow',
    method: 'post',
    data,
  })
}
// ——删除
export function setCustomerDel(data) {
  return request({
    url: '/system/customer/pool/delete_batch',
    method: 'post',
    data,
  })
}
// ——详情
// export function getCustomerDetail(id) {
//   return request({
//     url: `/system/pool/${id}`,
//     method: "get",
//   });
// }
// ——批量分配跟进人
export function setDistribute(data) {
  return request({
    url: '/system/customer/pool/allocation',
    method: 'put',
    data,
  })
}

// 销售池
// ——查询
export function getFollowPool(params) {
  return request({
    url: '/system/customer/pool/follow_poll',
    method: 'get',
    params,
  })
}
// ——放弃跟进、开发完成
export function setStatus(data) {
  return request({
    url: '/system/customer/pool/status',
    method: 'post',
    data,
  })
}
// ——跟进详情-查询
export function getFollowDetail(data) {
  return request({
    url: ' /system/customer/foll/details',
    method: 'get',
    data,
  })
}
// ——跟进详情-新增
export function addFollowDetail(data) {
  return request({
    url: `/system/customer/foll/details/${ data.followUpPerson }`,
    method: 'post',
    data,
  })
}
// ——跟进详情-修改
export function editFollowDetail(data) {
  return request({
    url: `/system/customer/foll/details/${ data.followUpPerson }`,
    method: 'put',
    data,
  })
}
// ——跟进详情-删除
export function delFollowDetail(data) {
  return request({
    url: `/system/customer/foll/details/${ data.id }/${ data.followUpPerson }`,
    method: 'delete',
  })
}
